package com.service;

import com.entity.Message;
import com.entity.User;

import java.sql.SQLException;

/**
 * @ProjectName: shop
 * @Author: Jsx
 * @Time: 2020/8/30 12:42
 * @Description:
 */
public interface UserService {

    /**
     * 检查账号是否存在
     * @param username
     * @return
     */
    Message checkUser(String username) throws SQLException;

    /**
     * 注册业务
     * @param user
     * @return  返回的状态码 0 1
     */
    int register(User user) throws SQLException;

    /**
     * 激活业务
     * @param code
     * @return
     */
    int activeUser(String code) throws SQLException;

    /**
     * 用户登录业务
     * @param username
     * @param password
     * @return
     */
    User login(String username,String password) throws SQLException;
}
